#/bin/bash


Files=`for f in "$@"; do
	echo $f; 
done | grep "src.*\.g"`;

echo "Files: $Files";

shopt -s extglob;

for f in $Files; do
	dir=${f%%*([^\\/])};
	file=${f##*[\\/]};
	#echo "Directory: $dir";
	#echo "File: $file";
	[[ -n $f ]] &&
	cd "$dir" &&
	java org.antlr.Tool "$file"; 
done

#[[ -n $Files ]] && java org.antlr.Tool "$Files";
